package com.xinchuang.mapper.targetSystem.scene;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xinchuang.entity.targetSystem.scene.SceneTargetList;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @ClassName SceneTargetListMapper
 * @Description: TODO(写一段描述的话)
 * @Author zhangxuan
 * @Date 2024-05-14 15:12
 * @Verion V1.0
 */
public interface SceneTargetListMapper extends BaseMapper<SceneTargetList> {

    @Select(value = {
            "SELECT tl.*,bd.target_name FROM scene_target_list tl JOIN target_base_data bd ON tl.target_id = bd.target_id WHERE tl.scene_id = #{sceneId}"
    })
    @Results(value = {
            @Result(property = "subList", many = @Many(select = "com.xinchuang.mapper.targetSystem.scene.SceneSubListMapper.selectSubList"), column = "{sceneId=scene_id,targetId=target_id}")
    })
    List<SceneTargetList> selectTargetList(String sceneId);


}
